#include<stdio.h>
#include<string.h>
#define MAX 100
int main()
{
	char str[MAX];
	scanf("%s",str);
	int len=strlen(str);
	int i=0;
	while(i<len)
	{
		if(str[i]=='Y')
		{
			break;
		}
		else if(str[i]=='M')
		{
			printf("Monday\n");
			i+=1;
		}
		else if(str[i]=='T'&&i+1<len)
		{
			if(str[i+1]=='u')
			{
				printf("Tuesday\n");
				i+=2;
			}
			else if(str[i+1]=='h')
			{
				printf("Thursday\n");
				i+=2;
			}
			else
			{
				printf("Wrong data\n");
				i+=1;
			}
		}
		else if(str[i]=='W')
		{
			printf("Wednesday\n");
			i+=1;
		}
		else if(str[i]=='F')
		{
			printf("Friday\n");
			i+=1;
		}
		else if(str[i]=='S'&&i+1<len)
		{
			if(str[i+1]=='a')
			{
				printf("Saturday\n");
				i+=2;
			}
			else if(str[i]=='S'&&str[i+1]=='u')
			{
				printf("Sunday\n");
				i+=2;
			}
			else 
			{
				printf("Wrong data\n");
				i+=1;
			}
		}
		else 
		{
			printf("Wrong data\n");
			i+=1; 
		}
	}
	return 0;
} 
